home *** CD-ROM | disk | FTP | other *** search
/ PC Elektro 3 / PC-Elektro-3-cd1.bin / KBan 2.0 / KBANSRC.LZH / SRC / PROG / KBANDATA / APTTABLE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-14  |  660 b   |  36 lines

  1. /*
  2.  * a header of the class APT_TABLE
  3.  * Copyright (C) 1996, 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
  4.  */
  5.  
  6. #ifndef _APTTABLE_H_
  7. #define _APTTABLE_H_
  8.  
  9. #include <algorithm>
  10. #include <vector>
  11.  
  12. #include "../common/bool.h"
  13.  
  14. #include "apt.h"
  15.  
  16. #define APERTURE_TABLE_SIZE 100
  17.  
  18. class APT_TABLE : public std::vector<APERTURE> {
  19. public:
  20.   void sort(void) {
  21.     std::sort(begin(), end());
  22.   }
  23.   int is_included(const APERTURE &apt) const {
  24.     for(uint i = 0; i < size(); i++) {
  25.       if((*this)[i] == apt) {
  26.         goto succeeded;
  27.       }
  28.     }
  29.     return false;
  30.   succeeded:
  31.     return true;
  32.   }
  33. };
  34.  
  35. #endif /* _APTTABLE_H_ */
  36.